<?php
class friendEngine extends Controller {
	function friendEngine(){
		parent::Controller();	
	}
	
	function request(){
		$this->load->model('Friend');
		$user_id= $this->input->post('user_id');
		$friend_id = $this->input->post('friend_id');
		if($this->Friend->addRequest($friend_id,$user_id)){
			echo json_encode(array("success"=>TRUE));
		}
		else{
			echo json_encode(array("success"=>FALSE));
		}
	}
	function removeUs(){
		$this->load->model('Friend');
		$user_id= $this->input->post('user_id');
		$friend_id = $this->input->post('friend_id');
		if($this->Friend->removeThem($friend_id,$user_id)){
			echo json_encode(array("success"=>TRUE));
		}
		else{
			echo json_encode(array("success"=>FALSE));
		}
	}
}